package com.example.intelglasses;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

public class DBManager {
	public  SQLiteDatabase db;

	public DBManager(Context context) {
	}

	public List<String[]> query() {
		db = SQLiteDatabase.openOrCreateDatabase("/sdcard/oscdata", null);
		ArrayList<String[]> strs = new ArrayList<String[]>();
		Cursor cursor = db.rawQuery("select * from mydata order by date desc", null);

		while (cursor.moveToNext()) {
			String[] str = new String[] { cursor.getString(cursor
					.getColumnIndex("date")) };
			strs.add(str);  
		}
		cursor.close();
//		db.close();
		return strs;
	}
}
